namespace RawRestructure.Models;

/// <summary>
/// 分批发送配置
/// </summary>
public class BatchSendConfig
{
    /// <summary>
    /// 每批发送数量
    /// </summary>
    public int BatchSize { get; set; } = 10;

    /// <summary>
    /// 发送间隔时间(毫秒)
    /// </summary>
    public int SendIntervalMs { get; set; } = 50;

    /// <summary>
    /// 起始索引
    /// </summary>
    public int StartIndex { get; set; } = 1;

    /// <summary>
    /// 创建默认配置
    /// </summary>
    /// <returns>默认配置实例</returns>
    public static BatchSendConfig CreateDefault()
    {
        return new BatchSendConfig
        {
            BatchSize = 10,
            SendIntervalMs = 50,
            StartIndex = 1
        };
    }

    /// <summary>
    /// 验证配置参数是否有效
    /// </summary>
    /// <returns>是否有效</returns>
    public bool IsValid()
    {
        return BatchSize > 0 && 
               SendIntervalMs >= 0 && 
               StartIndex > 0;
    }
} 